@extends('default.layouts.personalPublic')
@section('title', '面试通知')
@section('headcss')
    @parent
    <link rel="stylesheet" href="{{asset('/default/css/personal/resumeList.css')}}">
@endsection
@section('rightcon')
    <div class="right">

        <!--面试通知-->
        <div class="jright">
            <div class="content">
                <div class="jobtitle">
                    <div class="tithead">
                        <h2>面试通知</h2>
                    </div>
                </div>
                {{--\搜索内容--}}
                <div class="jobsearch">
                    <form name="Formso" id="Formso" action="{{url('personal/interview')}}" method="post">
                        {{csrf_field()}}
                        <span><input name="keyword" class="keyword" id="keyword" placeholder="请输入公司名称或者职位名称" type="text"/></span>
                         <span><input name="submit" class="searpos" value="" type="submit"/></span>
                    </form>
                </div>
                {{--显示列表--}}
                <div class="pinfo">
                    <form name="thisForm" action="" method="post">
                        {{csrf_field()}}
                        <div class="listmenu">
                                <ul class="one">
                                    <li class="p1"><input name="" class="checkboxs" value="234" type="checkbox" onclick="CheckAll(this)" /></li>
                                    <li class="p2">职位名称</li>
                                    <li class="p3">薪资待遇</li>
                                    <li class="p4">面试地点</li>
                                    <li class="p5">面试时间</li>
                                    <li class="p6">操作</li>
                                </ul>
                            <div class="information"><span>共收到<em>{{$interview->total()}}</em>条面试通知！</span></div>
                            {{--循环--}}
                            @if($interview->count() > 0 )
                                @foreach($interview as $v)
                                    <ul id="list{{$v->id}}">
                                        <li class="p1">
                                            <input name="selected_id[]" class="checkboxs" value="{{$v->id}}" type="checkbox"/>
                                        </li>
                                        <li class="p2">
                                            <span class="jpost"><a href="{{url('jobinfo_'.idEncryption($v->job_id).'.html')}}" target="_blank">{{$v->job_title}}</a></span>
                                            <span class="jcompany"><a class="company" href="{{url('comabout_'.idEncryption($v->com_id).'.html')}}" target="_blank">{{$v->company_name}}</a></span>
                                        </li>
                                        <li class="p3">
                                            @if(empty($v->salary_above))面试@else{{$v->salary_above}}~{{$v->salary_below}}元/月@endif
                                        </li>
                                        <li class="p4">{{$v->region}}</li>
                                        <li class="p5">{{$v->interview_time}}</li>
                                        <li class="p6" style=" margin-top: 25px;">
                                            <div class="status">
                                                <input id="job_status" name="job_status" type="hidden" value="{{$v->status}}">
                                                <div id="job_status_select" class="select" style="width:136px;"><span><a></a></span><i></i></div>
                                            </div>
                                        </li>
                                    </ul>
                                @endforeach
                                @else
                                <div class="nullcon">对不起！没有符合条件的记录！</div>
                            @endif
                            <ul class="one last">
                                <li class="p1" style="width:80px;">
                                    <input name="selectall" id="selectall" class="checkboxs" value="234" type="checkbox" onclick="CheckAll(this)"/>
                                    <label for="selectall">全选</label>
                                </li>
                                <li class="p2"><span class="pborder" onclick="showconfirm('{{url('personal/interview_del')}}','1')">删除记录</span></li>
                            </ul>
                        </div>
                    </form>
                </div>
                {{--分页--}}
                <div class="page_list" style="width: 100%; float: left; margin-top:15px;">
                    {!! $interview->appends($appends)->links() !!}
                </div>
            </div>
        </div>
    </div>
@endsection
@section('footerjs')
    @parent
    <script>
        $('#interview').addClass('on');
        $(function(){
            var status = [
//                {"value":0,"text":"未处理"},
//                {"value":1,"text":"已查看"},
                {"value":2,"text":"同意邀约"},
                {"value":3,"text":"婉拒邀约"}
            ];
            var listmenu = $('.right').find('.pinfo').find('.listmenu');
            @if($interview->count() > 0 )
                @foreach($interview as $v)
                    listmenu.find("#list" + '{{$v->id}}').find("#job_status").select({
                        defaults:null,//默认按索引选中null为不选
                        defaultFill:[{"value": '', "text": "@if($v->status == 0)未处理@else已查看@endif"}],//当defaults为null时,填空使用这个
                        optionData: status,
                        selected:'@if($v->status != 0 && $v->status != 1){{$v->status}}@endif',
                        callback:function(val,text){
                            $.post("/personal/interview_status",{'id':'{{$v->id}}','status':val,'_token':"{{csrf_token()}}"},function (data) {
                                if(data.status==0){
                                    layer.msg(data.msg, {icon: 6,time:1500});
                                }else{
                                    layer.msg(data.msg, {icon: 5,time:1500});
                                }
                            });
                        }
                    });
                @endforeach
            @endif
        });
        @if(session('ok'))
        layer.ready(function(){
            layer.msg('{{session('ok')}}',{time:1000});
        });
        @endif
    </script>
    <script type="text/javascript" src="{{asset('/default/js/personal/resumeList.js')}}"></script>
@endsection